<div class="nav">
    <a href="{:U('index')}">类别列表</a>
    <a class="sel" href="#">修改类别</a>
</div>
<div class="add">
    <form method="post" action="" >
        <table class="table_add">
            <tr>
                <td width="150px">所属类别</td>
                <td><select name="parent_id" id="parent_id" class="sel1">
                        <option value="0">顶级类别</option>
                        <foreach name="parentList" item="item">
                            <option value="{$item.cat_id}" >{$item.cat_name}</option>
                        </foreach>
                    </select>
                </td>
            </tr>
            <tr>
                <td width="150px">类别名称</td>
                <td><input class="input1" type="text" name="cat_name" id="cat_name" value="{$model.cat_name}" style="width:140px" /> </td>
            </tr>
            <tr class="tr_module" id="tr_module_1" style="display:none">
                <td width="150px">跳转地址</td>
                <td><input class="input1" type="text" name="url" id="url" value="{$model.url}" style="width:500px" /> </td>
            </tr>
            <tr class="tr_ico">
                <td>分类图标</td>
                <td>
                    <include file="Public/uploadfile" filetype="image" id="ico"  value="{$model.ico}" editvalue="{:getEditFiles($model['ico'])}" width="100" path="cat" limit="1" thumbw="" thumbh="" msg="75px*75px"/>
                </td>
            </tr>
            <eq name="model['cat_level']" value="1">
               <tr>
                <td>广告图片</td>
                <td>
                <include file="Public/uploadfile" filetype="image" id="adv_picture"  value="{$model.adv_picture}" editvalue="{:getEditFiles($model['adv_picture'])}" width="100" path="cat" limit="10" thumbw="" thumbh="" msg="宽度200px"/>
             </td>
            </tr>
                <tr>
                <td width="150px">广告链接</td>
                <td><textarea class="textarea1" name="adv_links" id="adv_links" style="width:500px;height:200px;">{$model.adv_links}</textarea>换行分隔链接</td>
            </tr>
            <tr><td>手机大类轮播图</td><td>
            
            <a onclick="picture_list({$model.cat_id},'{$model.cat_name}')" class="btn_a3">图片管理</a></td></tr>
            </eq>
            <eq name="model['cat_level']" value="3">
                      <tr>
                <td>手机第三级类图片</td>
                <td>
                <include file="Public/uploadfile" filetype="image" id="picture"   value="{$model.picture}" editvalue="{:getEditFiles($model['picture'])}" width="100" path="cat" limit="1" thumbw="220" thumbh="220" msg="220px*220px"/>
                
                </td>
            </tr>
            </eq>
            <tr>
                <td width="150px">顺序编号</td>
                <td><input class="input1" type="text" name="order_id" id="order_id" value="{$model.order_id}" style="width:60px" /> <label class="msg">*</label></td>
            </tr>
            <tr>
                <td width="150px">是否启用</td>
                <td><select name="is_enable" id="is_enable" class="sel1">
                        <option value="1">启用</option>
                        <option value="0">不启用</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td width="150px">导航显示</td>
                <td><select name="is_menu" id="is_menu" class="sel1">
                        <option value="0">不显示</option>
                        <option value="1">显示</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td width="150px">页面标题</td>
                <td><input class="input1" type="text" name="seo_title" id="seo_title" value="{$model.seo_title}" style="width:500px" /></td>
            </tr>
            <tr>
                <td width="150px">页面关键词</td>
                <td><input class="input1" type="text" name="seo_keywords" id="seo_keywords" value="{$model.seo_keywords}" style="width:500px" /></td>
            </tr>
            <tr>
                <td width="150px">页面描述</td>
                <td><textarea class="textarea1" name="seo_description" id="seo_description" style="width:500px;height:80px;">{$model.seo_description}</textarea></td>
            </tr>
            <tr>
                <td></td>
                <td><input type="submit" class="btn1" value="提 交" /> &nbsp; <input class="btn4"  type="reset" value="重 置" /> &nbsp; <input class="btn3"  type="button" onclick="window.history.back()" value="返 回" /></td>
            </tr>
        </table> 
        <input type="hidden" name="cat_id" value="{$model.cat_id}" />
    </form>
</div>
<script src="__PUBLIC__/common/artDialog4.1.7/artDialog.source.js?skin=blue" type="text/javascript"></script>
<script src="__PUBLIC__/common/artDialog4.1.7/plugins/iframeTools.source.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function() {
        $("#parent_id").val('{$model.parent_id}');
        $("#is_enable").val('{$model.is_enable}');
        $("#is_menu").val('{$model.is_menu}');
        $("#parent_id").change(function() {
            var parent_id = $("#parent_id").val();
            if (parent_id == 0) {
                $(".tr_ico").show();
            } else {
                $(".tr_ico").show();
            }
        });
        var parent_id = $("#parent_id").val();
        if (parent_id != 0) {
            $(".tr_ico").show();
        }
    })
	
	function picture_list(typeid,type_name) {
  
    url_picture = "{:U('SortBanner/index')}?typeid="+typeid
    art.dialog.open(url_picture, {title: type_name+"-图片列表", width: "1000px", height: "500px"});
   }
</script>